--- /dev/null
+//! Hand written bindings for ostree-core.h
+
+use glib::VariantDict;
+
+/// The type of a commit object: `(a{sv}aya(say)sstayay)`
+pub type CommitVariantType = (
+ VariantDict,
+ Vec<u8>,
+ Vec<(String, Vec<u8>)>,
+ String,
+ String,
+ u64,
+ Vec<u8>,
+ Vec<u8>,
+);
+
+/// The type of a dirtree object: `(a(say)a(sayay))`
+pub type TreeVariantType = (Vec<(String, Vec<u8>)>, Vec<(String, Vec<u8>, Vec<u8>)>);
+
+/// The type of a directory metadata object: `(uuua(ayay))`
+pub type DirmetaVariantType = (u32, u32, u32, Vec<(Vec<u8>, Vec<u8>)>);
// handwritten code
mod checksum;
pub use crate::checksum::*;
+mod core;
+pub use crate::core::*;
+
#[cfg(any(feature = "v2018_6", feature = "dox"))]
mod collection_ref;
#[cfg(any(feature = "v2018_6", feature = "dox"))]
--- /dev/null
+use crate::util::*;
+use std::error::Error;
+
+#[test]
+fn variant_types() -> Result<(), Box<dyn Error>> {
+ let tr = TestRepo::new();
+ let commit_checksum = tr.test_commit("test");
+ let repo = &tr.repo;
+ let commit_v = repo.load_variant(ostree::ObjectType::Commit, commit_checksum.as_str())?;
+ let commit = commit_v.get::<ostree::CommitVariantType>().unwrap();
+ assert_eq!(commit.3, "Test Commit");
+ Ok(())
+}